package com.spring.gll.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/modelController")
public class ModelController {
    @RequestMapping("/model")
    public String model(Model model){
        model.addAttribute("name","qqq");
        return "model";
    }
    @RequestMapping("/modelAndView")
    public ModelAndView modelAndView(){
        ModelAndView model = new ModelAndView("model");
        model.addObject("name","xxx");
        return model;
    }
}